package org.bsplus.util.security;

import org.bsplus.domain.Role;
import org.springframework.security.core.GrantedAuthority;

/**
 * Implementation of GrantedAuthority that delegates to org.bsplus.domain.Role
 */
public class GrantedAuthorityImpl implements GrantedAuthority
{
    private Role role;

    public GrantedAuthorityImpl(Role role)
    {
        this.role = role;
    }

    @Override
    public String getAuthority()
    {
        return getRole().getDescription();
    }

    private Role getRole()
    {
        return role;
    }

}
